package com.leetcode.demo3Solution.JianOffer;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class offer16_11 {
    /* 递归  跳水板*/
    public static void main(String[] args) {
        Solution16 solution=new Solution16();
        for(int a : solution.divingBoard(1,1,0)){
            System.out.println("跳水板:"+a);
        }

    }
}
class Solution16{
    public int[] divingBoard(int shorter, int longer, int k) {
        int[] res;
        if(k>0){
            if(shorter==longer){
                res=new int[1];
                int min=shorter*k;
                res[0]=min;
                return res;
            }else {
                res=new int[k+1];
                int min=shorter*k;
                int max=longer*k;
                res[0]=min;
                res[k]=max;
                for(int i=1;i<=k;i++){
                    res[i]=min-shorter*i+longer*i;
                }
            }
        }else {
            res=new int[0];
            return res;
        }
        return res;
    }
}
